<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8"></meta>
    <title>登录</title>
</head>
	<link rel="stylesheet" th:href="@{/css/animate.min.css}"/>
	<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"/>
	<link rel="stylesheet" th:href="@{/css/font-awesome.min.css}"/>
	<link rel="stylesheet" th:href="@{/css/style.min.css}"/>
	<link rel="stylesheet" th:href="@{/css/iconfont.css}"/>
	<link rel="stylesheet" th:href="@{/scripts/validator-0.7.3/jquery.validator.css}"/>
	<link rel="stylesheet" th:href="@{/css/sweetalert/sweetalert.css}"/>
	<link rel="shortcut icon" th:href="@{/images/logo.ico}"/>
	<script th:src="@{/scripts/jquery.min.js}"></script>
	<script th:src="@{/scripts/validator-0.7.3/jquery.validator.js}"></script>
	<script th:src="@{/scripts/validator-0.7.3/local/zh_CN.js}"></script>
	<script th:src="@{/scripts/host.js}"></script>
	<script th:src="@{/scripts/sweetalert/sweetalert.min.js}"></script>
<body bgcolor="#FFFFFF">
   <div class="middle-box text-center loginscreen  ">
        <div >
            <div onclick="boke();" style="margin-top: 200px;margin-bottom: 10px;">
                <i class="icon" style="font-weight: bold;"> 该账号已经在登陆，您被系统踢出</i>
            </div>
            <form id="userForm" class=" animated rollIn" data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
                <div class="form-group">
                    <input type="text" class="form-control"  placeholder="用户名" data-rule="用户名:required" id = "username"/>
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" data-rule="密码:required;password" id = "password"/>
                </div>
                <div class="form-group col-xs-6" style="padding-left: 0px;">
                	<img src="/getGifCode"/>
                </div>
                <div class="form-group col-xs-6">
                    <span><input type="text" class="form-control" placeholder="验证码" data-rule="验证码:required" id = "vcode"/></span>
                </div>
                <div class="form-group" style="text-align : left">
					<label><input type="checkbox" id="rememberMe" style="width: 12px; height: 12px;margin-right: 5px;"/>记住我</label>
				</div>
                <button type="submit" class="btn btn-primary block full-width " onclick="login();">登 录</button>
            </form>
            <br/>
            <br/>
            <div class = "animated bounceInLeft" onclick="site();">
                © 2017 All Rights Reserved. 海量应用能力中心
            </div>
        </div>
    </div>
<!-- 	<div class="part" style="z-index:-1;position:fixed;height:100%;width:100%;top:0;left:0"></div> -->
</body>
<script>
function site(){
	location.href = "http://www.hylanda.com/";
}

function login() {
	var username = $("#username").val();
	var password = $("#password").val();
	var vcode = $("#vcode").val();
	var rememberMe =$('#rememberMe').is(':checked');
	$.ajax({
		type : "POST",
		data : {
			"username" : username,
			"password" : password,
			"vcode" : vcode,
			"rememberMe" : rememberMe
		},
		dataType : "json",
		url : "/ajaxLogin",
		success : function(result) {
			
			if (result.status != 200) {
				swal("系统繁忙!",result.message,"error");
			} else {
// 				swal({title:"太帅了",text:"登录成功，进入系统！",type:"success"}, 
// 					function () {
					
// 			    });
				location.href = "/index";
			}
		}
	});
}
</script>
</html>